package song.NO_2;

import java.util.ArrayList;

public class Lianbiao implements Link{
    private Node head = null;
    public Lianbiao(){}
    public Lianbiao(final int[] nums){
        this.head = new Node();
        for (int m = nums.length-1; m >= 0; --m){
            Node move = new Node(nums[m]);
            move.next_set(head.next_return());
            head.next_set(move);
        }
    }
    public Node head_return(){
        return this.head;
    }

    @Override
    public void print(final Node head) {
        Node move = head.next_return();
        while (move != null){
            System.out.println(move.num_return());
            move = move.next_return();
        }
    }
}
